var testData = Array.from({length: 5000}, () => Math.round(Math.random() * 10) )

var res = testData.filter((d, index) => testData.indexOf(d) === index)

console.log(res)